session中删除照片时偶发显示错误

chengzhenyu 8 anni fa
parent
commit
5a1b4629d9

+ 2 - 0
app/src/main/java/ai/pai/lensman/session/PhotoRecyclerAdapter.java

@@ -46,6 +46,7 @@ public class PhotoRecyclerAdapter extends RecyclerView.Adapter<PhotoRecyclerAdap
46 46
         if(!photoList.contains(item)){
47 47
             photoList.add(0,item);
48 48
             notifyItemInserted(0);
49
+            notifyItemRangeChanged(0,photoList.size());
49 50
         }
50 51
     }
51 52
 
@@ -55,6 +56,7 @@ public class PhotoRecyclerAdapter extends RecyclerView.Adapter<PhotoRecyclerAdap
55 56
         }
56 57
         photoList.remove(index);
57 58
         notifyItemRemoved(index);
59
+        notifyItemRangeChanged(0,photoList.size());
58 60
     }
59 61
 
60 62
     @Override

+ 1 - 0
app/src/main/java/ai/pai/lensman/session/SessionPresenter.java

@@ -87,6 +87,7 @@ public class SessionPresenter implements SessionContract.Presenter, SessionInter
87 87
         }
88 88
         if(BuildConfig.isTestMode){
89 89
             if(photoList!=null && photoList.size()>5){
90
+                interactor.endSession();
90 91
                 return;
91 92
             }
92 93
         }